programming4us
           
 
 
SQL Server

SQL Azure : Creating Databases, Logins, and Users (part 1)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/18/2010 9:15:31 AM
This section provides a quick and high-level overview of using T-SQL syntax to create databases and users. 

You've walked through how to create and manage databases using the SQL Azure Portal, but now let's use SQL Server Management Studio (SSMS) to create and manage a database. This book uses SQL Server 2008 R2 throughout for the examples.

Fire up SQL Server 2008 R2, and enter the FQDN of the database server name in the "Server name" box when the Connect to Server dialog appears (see Figure 1). Enter the administrator login name and password, and click Connect. You're now connected to SQL Azure.

Figure 1. Connecting to SQL Azure via SSMS

At this juncture, the only database available to you is the master database, unless you've created databases via the SQL Azure Portal. Let's spend a few minutes discussing how to create databases and other objects using T-SQL.

1. Databases

When you create databases in a non-Azure environment, you have to know and specify a lot in the CREATE statement. For example, you must provide the path and physical object names of the database and log files, as well as the database size and optionally the maximum size and file growth. A CREATE DATABASE statement in a non-Azure environment might look like the following:

CREATE DATABASE [MyDatabase] ON  PRIMARY
( NAME = N'MyDatabase', FILENAME = N'C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\MyDatabase.mdf' , SIZE = 32768KB , MAXSIZE =
UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MyDatabase_log', FILENAME = N'C:\Program Files\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\MyDatabase_log.ldf' , SIZE = 92864KB , MAXSIZE = 2048GB
, FILEGROWTH = 10%)
GO


As you've learned in the past few chapters, with Azure you don't have to worry about hardware and where objects are located and how hardware is provisioned, which makes statements such CREATE DATABASE much simpler.

CREATE DATABASE MyDatabase

You can optionally supply two parameters with the CREATE DATABASE statement: MAXSIZE, which specifies the maximum size of the database; and EDITION, which specifies the edition of the database (Web or Business). Here's an example:

CREATE DATABASE MyDatabase (MAXSIZE= 10 GB, EDITION= 'Business')

In the current release of SQL Azure, two database sizes are available for the Web edition: 1GB and 5GB. For the Business edition, available sizes range from 10GB to 50GB, in increments of 10GB. If MAXSIZE is set to a value of 1GB or 5GB and EDITION isn't specified, the database edition is automatically set to Web. If MAXSIZE is set to a value between 10BG and 50GB and EDITION isn't specified, the database edition is automatically set to Business. If neither MAXSIZE nor EDITION is specified, a Web database of 1GB is created.

SQL Azure doesn't support additional arguments that you're used to using when working with SQL in a local environment. For example, SQL Azure doesn't support parameters that relate to working with physical files, such as filespec and filegroup. You also can't attach or detach a database.

Other -----------------
- SQL Azure : Azure Server Administration (part 3) - Databases
- SQL Azure : Azure Server Administration (part 2) - Firewall Settings
- SQL Azure : Azure Server Administration (part 1) - Server Information
- SQL Azure : Managing Your Azure Projects
- SQL Azure : Creating Your Azure Account
- An OLAP Requirements Example: CompSales International (part 16) - Security and Roles
- An OLAP Requirements Example: CompSales International (part 15) - SSIS
- An OLAP Requirements Example: CompSales International (part 14) - Data Mining
- An OLAP Requirements Example: CompSales International (part 13) - Cube Perspectives
- An OLAP Requirements Example: CompSales International (part 12) - Generating a Relational Database
- An OLAP Requirements Example: CompSales International (part 11)
- An OLAP Requirements Example: CompSales International (part 10)
- An OLAP Requirements Example: CompSales International (part 9) - Browsing Data in the Cube
- An OLAP Requirements Example: CompSales International (part 8) - Aggregating Data Within the Cube
- An OLAP Requirements Example: CompSales International (part 7) - Building and Deploying the Cube
- An OLAP Requirements Example: CompSales International (part 6) - Creating the Cube
- An OLAP Requirements Example: CompSales International (part 5) - Creating the Other Dimensions
- An OLAP Requirements Example: CompSales International (part 4) - Defining Dimensions and Hierarchies
- An OLAP Requirements Example: CompSales International (part 3) - Creating Data Source Views
- An OLAP Requirements Example: CompSales International (part 2) - Adding a Data Source
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us